﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AimGameLibrary.GameObject
{
    public class GameOperators : BaseGameObject
    {
        protected int[] ValueInt = { 0, 0 };
        protected float[] ValueFloat = { 0, 0 };

        public override void LoadData(Identification getdata, int IndexData, NodeData node)
        {
            Listnameparent.Add(Script.GetName(node.Data, 2, 0));
            Listnameparent.Add(Script.GetName(node.Data, 2, 1));
        }


        public override void UpdateTime(TimeSpan timespan)
        {
            base.UpdateTime(timespan);
            if (Listparent.Count == 2)
                Logic();
            
        }

        public override void UpdateGameTime(Microsoft.Xna.Framework.GameTime gametime)
        {
            base.UpdateGameTime(gametime);
            if (Listparent.Count == 2)
                Logic();
            
        }
        
        void Case()
        {
            if (Listparent[0].GetType() == typeof(GameInt))
            {
                GameInt tempInt = (GameInt)Listparent[0];
                ValueInt[0] = tempInt.MyinT;
            }
            else if (Listparent[0].GetType() == typeof(GameFloat))
            {
                GameFloat tempFloat = (GameFloat)Listparent[0];
                ValueFloat[0] = tempFloat.MyfloaT;
            }

            if (Listparent[1].GetType() == typeof(GameInt))
            {
                GameInt tempInt = (GameInt)Listparent[1];
                ValueInt[1] = tempInt.MyinT;
            }
            else if (Listparent[1].GetType() == typeof(GameFloat))
            {
                GameFloat tempFloat = (GameFloat)Listparent[1];
                ValueFloat[1] = tempFloat.MyfloaT;
            }
        }

        protected virtual void Logic()
        { 
        
        }
    }
}
